package com.project.webpage.controller;


import com.github.pagehelper.PageInfo;
import com.project.webpage.aop.TagLog;
import com.project.webpage.dto.SearchByMonthParam;
import com.project.webpage.service.CompanyOperationAppealedService;
import com.project.webpage.util.RestResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/webpage/company/operation/appealed")
public class CompanyOperationAppealedController extends BaseController {

    @Resource
    CompanyOperationAppealedService companyOperationAppealedService;

    /**
     * 企业申诉后月考评列表查询
     */
    @PostMapping("page")
    @TagLog(operation = 0, content = "查询企业申诉后月考评列表")
    public RestResult page(@RequestBody SearchByMonthParam param) {
        this.getPage(true, param);
        return RestResult.ok(new PageInfo<>(companyOperationAppealedService.getListForPage(param)));
    }

    /**
     * 企业申诉后月考评导出列表
     */
    @PostMapping("output")
    @TagLog(operation = 5, content = "导出企业申诉后月考评列表")
    public RestResult output(@RequestBody SearchByMonthParam param) {
        this.getPage(false, param);
        return RestResult.ok(companyOperationAppealedService.getListForPage(param));
    }
}
